<%= form_with(model: [@theme, task], local: true) do |form| %>
  <% if task.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(task.errors.count, "error") %> prohibited this task from being saved:</h2>

      <ul>
        <% task.errors.full_messages.each do |message| %>
          <li><%= message %></li>
        <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
      <%= form.label :name %>
      <%= form.text_field :name, autofocus: true %>
  </div>

  <div class="field">
    <%= form.label :deadline %>
    <%= form.date_select :deadline %>
  </div>

    <%= form.hidden_field :user_id, value: @current_user.id %>

  <div class="actions">
    <%= form.submit %>
  </div>
<% end %>
